package com.blrs.service;
import com.blrs.common.core.domain.AjaxResult;
import com.blrs.domain.vo.FlowTaskVo;
import org.flowable.engine.history.HistoricProcessInstance;

import java.util.Map;

/**
 * @author yuxiang.chen
 * @date 2023-08-03 14:40
 */
public interface IFlowInstanceService {

    /**
     * 结束流程实例
     *
     * @param vo
     */
    void stopProcessInstance(FlowTaskVo vo);

    /**
     * 激活或挂起流程实例
     *
     * @param state      状态
     * @param instanceId 流程实例ID
     */
    void updateState(Integer state, String instanceId);

    /**
     * 删除流程实例ID
     *
     * @param instanceId   流程实例ID
     * @param deleteReason 删除原因
     */
    void delete(String instanceId, String deleteReason);

    /**
     * 根据实例ID查询历史实例数据
     *
     * @param processInstanceId
     * @return
     */
    HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);

    /**
     * 根据流程定义ID启动流程实例
     *
     * @param procDefId 流程定义Id
     * @return
     */
    AjaxResult startProcessInstanceById(String procDefId,String id,String actId);
}
